#include "cpu/exec/template-start.h"

#define instr ror

static void do_execute () {
	DATA_TYPE src = op_src->val;
	DATA_TYPE_S dest = op_dest->val;

    while(src != 0){
        DATA_TYPE tmpcf = src &0x1;
        dest = dest / 2  + (tmpcf * (1<<(DATA_BYTE*8 - 1)));
        src -= 1;
    }
    if(op_src->val == 1){
        if((dest >> (DATA_BYTE*8 - 1)) != ((dest>>(DATA_BYTE*8 - 2)) & 0x1 )){
            cpu.eflags.OF = 1;
        }
        else{
            cpu.eflags.OF = 0;
        }
    }
	print_asm_template2();
}

make_instr_helper(rm_1)
make_instr_helper(rm_cl)
make_instr_helper(rm_imm)

#include "cpu/exec/template-end.h"
